/*
 * @Author: liyin 2179253556@qq.com
 * @Date: 2023-03-20 13:51:35
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2025-02-26 09:55:25
 * @FilePath: main.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { createApp } from 'vue'
// 引入pinia
import { createPinia } from 'pinia'
// 引入pinia持久化插件
import PiniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import router from './router'
// 引入iconfont
// import '../src/assets/css/font.css'
import './assets/fonts/iconfont.js'
import './assets/fonts/iconfont.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import 'element-plus/theme-chalk/el-loading.css'
import 'element-plus/es/components/message-box/style/index'
import 'element-plus/theme-chalk/el-message.css'
import '../src/assets/css/global.scss'
// 导入封装的util工具类
import Util from './util/util'
import { Message } from './util/message'
import Dot from './components/Common/Dot.vue'
import LayerFlex from './components/Common/LayerFlex.vue'
// 搜索组件
import SearchComp from './components/Common/SearchComponent.vue'
// 分页组件
import Pagination from './components/Common/Pagination.vue'
// table组件
import Table from './components/Common/Table.vue'
// rowitem
import RowItem from './components/Common/RowItem.vue'
// model自定义弹框组件
import Model from './components/Common/Model.vue'
// menu 子组件
import MenuListVue from './components/Common/MenuList.vue'
// svg 组件
import SvgIconVue from './components/Common/SvgIcon.vue'
// 暂无数据组件
import NoDate from "./components/Common/NoDate.vue"
// 导航nav
import TabsNav from "./components/Common/TabsNav.vue"
// 富文本编辑器
import Editor from "./components/Common/Editor.vue"
// 图片裁剪
import CropperImage from "./components/Common/CropperImage.vue"
import draggable from 'vuedraggable'
import directives from './util/directives'
import App from './App.vue'
// 注册pinia
const pinia = createPinia()
// 使用持久化插件
pinia.use(PiniaPluginPersistedstate)
const app = createApp(App)
app.component('Dot', Dot)
app.component('LayerFlex', LayerFlex)
app.component('SearchComp', SearchComp)
app.component('Pagination', Pagination)
app.component('Table', Table)
app.component('RowItem', RowItem)
app.component('Model', Model)
app.component('MenuListVue', MenuListVue)
app.component('SvgIcon', SvgIconVue)
app.component('draggable', draggable)
app.component('NoDate', NoDate)
app.component('TabsNav',TabsNav)
app.component('Editor', Editor)
app.component('CropperImage', CropperImage)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(ElementPlus, {
  locale: zhCn,
  fontSize: 16
})
// 全局注册使用util类
app.config.globalProperties.$util = Util
app.config.globalProperties.Message = Message
app.use(pinia)
app.use(router)
app.use(directives)
app.mount('#app')
